package com.wkbb.basic.utils;

import com.wkbb.common.enums.ProfilesActiveEnum;

import java.util.Date;

/**
 * @author caohongdan
 * @date 2020/8/7
 * @description
 */
public class VisitorUtil {

    /**
     * 计算邀约列表状态
     * @param beginTime
     * @param endTime
     * @return
     */
    public static short visitorStatus(Date beginTime, Date endTime)
    {
        Short status = 4;
        Long beginTimes = beginTime.getTime();
        Long endTimes = endTime.getTime();
        Long nowDates = new Date(System.currentTimeMillis()).getTime();
        if(beginTimes>nowDates){
            status = 4;
        }else if(endTimes<nowDates){
            status = 3;
        }else{
            status = 1;
        }
        return status;
    }

    /**
     * 访客发送的短信 - 环境地址
     * @param profilesActive 获取环境
     * @return
     */
    public static String visitorEvn(String profilesActive){
        String visitorUrl = "";
        if(profilesActive.equals(ProfilesActiveEnum.DEV.getDesc())){
            visitorUrl="http://192.168.5.89:9999/#/visitor?id=";
        }else if(profilesActive.equals(ProfilesActiveEnum.GRAY.getDesc())){
            visitorUrl="https://rewxweb.wkbaobao.com/#/visitor?id=";
        }else if(profilesActive.equals(ProfilesActiveEnum.TEST.getDesc())){
            visitorUrl="https://testwxweb.wkbaobao.com/#/visitor?id=";
        }else{
            visitorUrl="https://wxweb.wkbaobao.com/#/visitor?id=";
        }
        return visitorUrl;
    }


}
